package edu.tyut.game.utils;

import java.util.Arrays;
import java.util.List;

public class GetContents {
    public static List<String> getWords(List<String> contents, String word){
        return contents.parallelStream().flatMap(e -> Arrays.stream(e.split("[，。？！；：、\\s]+")))
                .map(String::trim)
                .filter(e -> e.contains(word)).toList();
    }
}
